import axios from "@/utils/request";

export function addMajor(params){
    return axios({
        method:"post",
        url:"/major",
        data:params
    })
}

export function deleteMajor(params){
    return axios({
        method:"delete",
        url:"/major",
        data:params
    })
}

export function updateMajor(params){
    return axios({
        method:"put",
        url:"/major",
        data:params
    })
}

export function selectMajor(params){
    return axios({
        method:"get",
        url:"/major",
        params: {
            pageNum:params.pageNum,
            pageSize:params.pageSize,
            search:params.search,
        }
    })
}

export function selectAllMajor(params){
    return axios({
        method:"get",
        url:"/major/selectAll",
        data:params
    })
}

export function selectMajorById(params){
    return axios({
        method:"get",
        url:"/major/selectOne",
        params: {
            department:params.department
        }
    })
}

export function majorCount(params){
    return axios({
        method:"get",
        url:"/major/majorCount",
        params: params
    })
}